package com.gitee.linmt.entity;

import java.util.Objects;

/**
 * 地址.
 *
 * @author <a href="mailto:lin-mt@outlook.com">lin-mt</a>
 */
public class Location {
    
    private Long id;
    
    private String address;
    
    public Location(final String address) {
        this.address = address;
    }
    
    public Long getId() {
        return id;
    }
    
    public Location setId(final Long id) {
        this.id = id;
        return this;
    }
    
    public String getAddress() {
        return address;
    }
    
    public Location setAddress(final String address) {
        this.address = address;
        return this;
    }
    
    @Override
    public boolean equals(final Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        
        final Location location = (Location) o;
        
        if (!Objects.equals(id, location.id)) {
            return false;
        }
        return address != null ? address.equals(location.address) : location.address == null;
    }
    
    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (address != null ? address.hashCode() : 0);
        return result;
    }
}
